package com.gdteam.kernel.i18n;

import java.io.InputStream;
import java.text.DecimalFormatSymbols;
import java.util.Locale;

public interface I18nManager {
    
    static String FQN = "com.gdteam.kernel.i18n.i18nmanager";
    
    /**
     * Set current locale of I18nManager
     * @param locale to set
     */
    void setCurrentLocale(Locale locale);
    
    /**
     * Get current locale
     * @return current locale
     */
    Locale getCurrentLocale();
    
    /**
     * Return translated message from key for current Locale
     * @param key
     * @return translated message from key for current Locale
     */
    String getLocalizedString(String key);
    
    /**
     * Get object which represents the set of symbols (such as the decimal separator, the grouping separator, and so on)
     * @return DecimalFormatSymbols object
     */
    DecimalFormatSymbols getLocalizedDecimalFormatSymbols();
    
    /**
     * Get localized file in classpath : baseDir/baseName_de_De.extension
     * @param baseDir 
     * @param baseName
     * @param extension
     * @return localized file in classpath
     * @throws IllegalArgumentException if file does not exist
     */
    InputStream getLocalizedFile(String baseDir, String baseName, String extension) throws IllegalArgumentException;
    
    /**
     * Get localized file in classpath : baseDir/baseName_de_De.extension. 
     * Calling this method is equivalent to calling getLocalizedFile(null, baseName, extension);
     * @param baseDir 
     * @param baseName
     * @param extension
     * @return localized file in classpath
     * @throws IllegalArgumentException if file does not exist
     */
    InputStream getLocalizedFile(String baseName, String extension);
}
